import request from '@/utils/request'

export default {
	
	//添加课程信息
	addCourseInfo(courseInfo) {
		return request({
			url: `/edu/course`,
			method: 'post',
			data: courseInfo
		})
	},
	//获取讲师信息
	getTeacherList() {
		return request({
			url: `/edu/teacher/findAll`,
			method: 'get'
		})
	},
	//根据id查询信息
	getInfoById(courseId){
		return request({
			url: `/edu/course/${courseId}`,
			method: 'get'
		})
	},
	//修改课程信息
	updateInfo(courseInfo){
		return request({
			url: `/edu/course`,
			method: 'put',
			data: courseInfo
		})
	},
	//获取发布课程信息
	getPublish(courseId){
		return request({
			url: `/edu/course/getPublish/${courseId}`,
			method: 'get'
		})
	},
	//课程最终发布
	finalPublish(courseId){
		return request({
			url: `/edu/course/finalPublish/${courseId}`,
			method: 'post'
		})
	},
	//查询所有课程
	getAll(){
		return request({
			url: `/eduService/course/getAll`,
			method: 'get'
		})
	},
	//讲师列表(条件查询 分页)
	getPageExample(current,size,courseQuery) {
		return request({
			url: `/eduService/course/getPageList?current=${current}&size=${size}`,
			method: 'post',
			//后端使用requestBody接收数据
			data:courseQuery
		})
	},
	//根据课程id删除课程
	deleteCourse(courseId) {
		return request({
			url: `/eduService/course/${courseId}`,
			method: 'delete'
		})
	}
	
	
}